package jmine.tec.services.api;

import bancosys.tec.exception.LocalizedMessageHolder;
import bancosys.tec.exception.MessageCreator;
import bancosys.tec.exception.MessageCreatorHelper;

/**
 * @author lundberg
 */
public enum ServicesAPIMessages implements MessageCreator {
    FACTORY_ILLEGAL_ACCESS_ERROR(1, "services.api.factory.illegalAccessError"),

    VALIDATION_VALIDATION_EXCEPTION(1, "services.validation.validationException"),

    EXPORTER_CODIFICATION_ERROR(1, "services.api.exporter.codificationError"),

    EXECUTION_ERROR_PROCESSING_SERVICES(1, "services.api.execution.errorProcessingServices"),

    IO_INVALID_ACTION_FOR_SERVICE(3, "services.io.invalidActionForService"),

    FACTORY_INSTANTIATION_ERROR(1, "services.api.factory.instantiationError"),

    INVALID_SERVICE_PARAMETERS(1, "services.api.invalidServiceParameters"),

    ANNOTATION_SERVICE_MISSING_ANNOTATION(1, "services.annotation.serviceMissingAnnotation"),

    EXPORTER_NOT_FOUND(1, "services.api.exporter.notFound"),

    VALIDATION_VALIDATION_ERROR(1, "services.api.validation.validationError"),

    EXECUTION_UNEXPECTED_ERROR(0, "services.api.execution.unexpectedError"),

    IO_IOEXCEPTION_READING_FILES(0, "services.io.IOExceptionReadingFiles"),

    INVALID_SERVICE_IMPLEMENTATION(1, "services.api.invalidServiceImplementation"),

    GENERIC_SERVICE_EXECUTION_ERROR(2, "services.genericServiceExecutionError"),

    GENERIC_EXECUTION_ERROR(1, "services.genericExecutionError");

    private final MessageCreator delegate;

    /**
     * Construtor
     * 
     * @param nargs nargs
     * @param key key
     */
    private ServicesAPIMessages(int nargs, String key) {
        this.delegate = MessageCreatorHelper.creator("jmine-tec-services-api-messages", key, nargs);
    }

    /**
     * {@inheritDoc}
     */
    public LocalizedMessageHolder create(Object... arguments) {
        return this.delegate.create(arguments);
    }

    /**
     * {@inheritDoc}
     */
    public int getExpectedArguments() {
        return this.delegate.getExpectedArguments();
    }
}
